package operation;

import book.Book;
import book.BookList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 阿宾
 * Date: 2024-07-22
 * Time: 16:56
 */
public class ShowOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("显示图书！");

        int currentSize = bookList.getUsedSize();
        if(currentSize == 0){
            System.out.println("当前书架上没有图书！！");
        }
        for (int i = 0; i < currentSize; i++) {
            Book book = bookList.getBook(i);
            System.out.println(book);
        }
    }
}
